#pragma once

#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Vector2.hpp>
#include "Animation.h"

class Player
{
public:
	Player();
	~Player();

	void initialize(sf::RenderWindow* window);
	void update();
	void cleanup();

	void move(float xDir, float yDir);

	sf::Sprite* m_playerSprite;
	sf::Sprite* m_playerLegs;
	
	int m_playerHealth;
	int shipHealth;
	sf::Clock* m_clock;

	bool isFainted;

	bool equipPistol;
	bool equipShotgun;
	bool equipMachinegun;

	bool firePistol;
	bool fireRifle;
	bool fireShotgun;

private:
	sf::RenderWindow* m_renderWindow;

	sf::Texture* m_mainChar_pistol_tex;
	sf::Texture* m_mainChar_rifle_tex;
	sf::Texture* m_mainChar_shotgun_tex;
	sf::Sprite* m_mainChar_pistol_sprite;
	sf::Sprite* m_mainChar_rifle_sprite;
	sf::Sprite* m_mainChar_shotgun_sprite;

	Animation* m_animation;
	Animation* m_pistol_fire_anim;
	Animation* m_rifle_fire_anim;
	Animation* m_shotgun_fire_anim;
	Animation* m_pistol_reload_anim;
	Animation* m_rifle_reload_anim;
	Animation* m_shotgun_reload_anim;

	sf::Sprite* m_legs;
	sf::Sprite* m_pistol_fire_sprite;
	sf::Sprite* m_rifle_fire_sprite;
	sf::Sprite* m_shotgun_fire_sprite;
	sf::Sprite* m_pistol_reload_sprite;
	sf::Sprite* m_rifle_reload_sprite;
	sf::Sprite* m_shotgun_reload_sprite;

	sf::Clock* pistol_fire_clock;
	sf::Clock* rifle_fire_clock;
	sf::Clock* shotgun_fire_clock;

	sf::Time pistol_fire_timer;
	sf::Time rifle_fire_timer;
	sf::Time shotgun_fire_timer;

	bool measurePistolTime;
	bool measureRifleTime;
	bool measureShotgunTime;
	
	sf::Time timeSinceLastFrame;
	bool isWalking;
};

